Top 10k strings from Interactive BASIC Programming (1985)(Eigen Software)(Tape 1 of 3 Side A).tzx
in <root> / bin / z80 / software / Sinclair Spectrum Collection TOSEC.exe / Sinclair ZX Spectrum - Utilities & Educational / Sinclair ZX Spectrum - Utilities & Educational - [TZX] (TOSEC-v2007-01-01) /
Back to the directory listing
10 Interactive 9 Programming 7 3 15*2-8/16*2+1 2 statement for each word. 2 ;"Loading, please wait!" 2 ;"Interactive BASIC Programming"; 2 ;"Copyright 2 4*(12+21-26)+27/(4+5) 2 0,1;"I N" 110 2 1985 Eigen Software" 2 EIGEN SOFTWARE"; 2 Try using a separate 2 create reality" 2 2 2 2 1 will delete the whole program completly. Try entering 1 we will explain it later). Press SYMBOL SHIFT and SPACE to continue. 1 used on their own will producepermanent colours.) 1 then enter 1 then a blank line is'printed'. But that's a bit bor-ing so let's print things incolour. 1 tells the computer that the next time it has to use the screen the background must be blue. But entering 1 statements. (Statement is the name given to a simple but complete BASIC instruction that the computer can execute.) 1 statements that contain unusualcharacters. Don't be afraid toexperiment! 1 statements can be inserted as often as you like in a program. They consist of text that describes what the programis doing. 1 statementon a separate line: 1 statement. There is no restrict-ion on the ordering but yourSpectrum executes them in theorder in which they appear. 1 statement on the next line. e.g. 1 state-ments. Use what ever you feelhappiest with. 1 state-ment instructs your Spectrum toprint the following text incolour 1 some more text 1 so 10 = 1/10 = 1/100 1 row,column;"some text" 1 programming 1 produces 14. You might haveexpected 20 but your Spectrumhas a special way of working outsums. 1 or 0.0434 Similarly 1 module b 1 module a 1 like this: 1 keyword is used todisplay text on the screen.Whatever you want to print mustbe placed between quotationmarks ( 1 item (itemsbeing the things that appearbetween semicolons) then eachtext item is printed directlyafter the previous one. A ; inthis context is known as aseparator. Two more separatorsare available on your Spectrum: the comma (,) and the apostrophe('). A comma causes the printingto start at the beginning or inthe middle (column 16) of theline, depending on which comesnext. 1 is used to separate the numbers. 1 is turned on in line 100 but does not need to be turned off for line 110 - the default value is taken. 1 is evaluated like this: 1 is an explanation of part of the BASIC language, often with suggested input for you to try." 1 is a number from 0 to 23 and 1 instructs your Spectrum to usecolour in the usual way. 1 e.g. 1 by stepping the cursorback over the keyword (using theleft-arrow key), delete and stepforward past the keyword. Thisis much easier than it sounds,try it! 1 are put into BASIC any program already there will be LOST FOREVER!" 1 are only temporary. 1 and single spaces toproduce a picture of a multi-coloured rainbow. 1 and print the underlining at thesame position as the text. 1 and press ENTER (notice that thequotes are not printed!). The text in this Learning Moduleis right justified. This meansthat the right-hand side of thetext is aligned to give a neatedge. Some people like rightjustified text, others don't: itis a matter for personal taste! 1 and is equal to 1250 1 and press the ENTER key (don't worryabout 1 You can place as many 'items'as you want in a single 1 Write a program that printsa simple picture using graphicscharacters. 1 Write a program that makes useof all the 1 Write a program that evaluates: 1 Write a program thatreproduces this line: 1 Work out the value of: 1 Without using your Spectrum,work out the value of this sum: 1 Welcome to 1 We recommend that you use the Learning Modules in the order inwhich they occur on the tape. You may find that you prefer a different order though (especially if you already know some BASIc)." 1 Try typing 1 Try it! (No need for 1 Throughout 1 This introductory Learning Module is not as clever as the rest. Had it been like the others you would have found it strange to use straight off. As you use 1 Then write a program thatprints an underlined title. 1 Then enter the statement 1 Then additions andsubtractions. 1 The text in Learnig Module B is right justified. This will enable you to decide whether youlike right justification or not. 1 The remainder of this introduct-ory program consists of several 1 The apostrophe separator causesthe printing to start at thebeginning of the next line. Try this: 1 Statements 1 Statement Problem Hinta Hintb Solution Extension 1 Statement 1 Solutions 1 So the sum is 1 Remember to use 1 RANDOMIZE USR 1 Press play on tape recorder. 1 Please note that our 1 Please note that it will not always be convenient to follow the form: 1 Note that these colours (magentaand yellow) only apply to thetext in this 1 Note that pressing CAPS SHIFTwhile in graphics mode gives thecharacter with 1 Multipilcation and divisionare carried out first, then add-ition and subtraction. 1 MODULE B 1 MODULE A 1 Learning Modules B to L contain many Learning Elements (don't worry about this, it's quite simple really!) The Learning Elements have the following parts: 1 Just to make it moreinteresting print two blank rowsbetween each letter. Use a diff-erent colour for each letter anddo it without using 1 It's a good idea to make theborder colour contrast with thepaper colour. 1 Interactive BASIC Programming 1 If you would like help with the 1 If you were to enter 1 If you want to step backwards through the Learning Module thenhold down SYMBOL SHIFT and pressENTER." 1 If you hold down SYMBOL SHIFT and then press SPACE (this combination of keys is not normally recognized by the Spectrum) the first part ( 1 If you enter 1 How does the keyboard achieve this? The answer is right underyour nose. All the BASIC commands and functions are staring you in the face from the word go. You are encouraged to discover how to use 1 Holding down SYMBOL SHIFT and pressing SPACE a second time produces the first 1 Fortunately your Spectrum has aninvaluble error checking facility: it will not accept input that it cannot understand.What's more, if you give it incorrect input then a flashing question mark ( 1 Don't worry about this program, just run it! It displays the Spectrum character set. 1 Discover the effect of leavinga semicolon (or other separator)at the end of a 1 Decimal tabulation 1 Created with Ramsoft MakeTZX 1 Connect EAR on Spectrum to EAR on tape recorder. 1 Check this by entering 1 Characters 144 to 164 can bedesigned by yourself but we willleave that for the time being. 1 By and large each Learning Module builds on information given in and knowledge aquired from previous Learning Modules. So you may have to refer to something missed out earlier. Having said that, feel free to select any part that takes your fancy as long as you understand what you're doing." 1 As you press keys the correspond-ing text (letters, words etc.) is displayed on the screen. Text entered like this is calledinput." 1 Ah, that's better! You should have noticed by now that the Spectrum screen is in two parts.The top part (usually 22 lines) is used to display words, numbers, pictures etc. The bottom part (usually 2 lines) is used to display what you type in." 1 Admittedly it takes time to become familiar with the keyboard but by now you'll have mastered this, having practised with the superb Keyboard Trainer{Keyboard Tutor} on the intro- ductory tape. What's that? Some of you have yet to use the Key- board Trainer? Don't just sit there, load it in; after all you've paid for it, and Psion {Dorling Kindersley} spent ageswriting it, just for you ..." 1 ANYTHING CONTAINED WITHINBRACKETS IS EXECUTED FIRST! 1 ? It is neither herenor there whether you use charac-ters 165 to 255 in 1 = 30 - 1 +1 1 = 2*(3+40+2) 1 = 2*(3+4*10+2) 1 = 2*(3+4*(56-5-41)+2) 1 = 2*(3+4*(56-25/5-41)+2) 1 = 2*(3+4*(56-(7+9*2)/5-41)+2) 1 ;"toggle sound: SPACE & ENTER" 1 ;"help: CAPS SHIFT & ENTER"; 1 ;"forward: SYMBOL SHIFT & SPACE"; 1 ;"backward: SYMBOL SHIFT & ENTER"; 1 ;"_______________" 1 ;"What ""will"" happen?" 1 ;"WARNING: if you enter 1 ;"This is a Title"; 1 ;"Press ENTER" 1 ;"Learning Module B" 1 ;"Learning Module A" 1 ;"Hello",,"there" 1 ; your program will be lost. 1 ; this avoidsconfusion with the letter x. Fordivision 1 8/16*2 = 0.5*2 = 1 1 8/16 = 0.5 1 6;"I am a multi-colour computer" 1 23,0;"not possible" 1 2*(3+4*(56-(7+9*(2.25-1/4))/5-41)+2) 1 2*(3+4*(56-(7+9*(2.25-1/4))/5- 41)+2) 1 1;"brown"; 1 1;"EIGEN SOFTWARE" 1 11,13;"middle" 1 0;"some more text" 1 0;"Separate" 1 0;" quick "; 1 0,1;100.01 1 0,0;"O U T" 1 0,0;"First" 1 .Set the border to a colour of your choice (NOW!). 1 .A third time will generate a BASIC 1 . You can then solve this 1 . This computer assisted learning (CAL) package will teach you how to use your Spectrum for BASIC programming. CAL is the best way to learn about computers because you haveto use a computer in order to follow the package. It's just like riding a bike: no matter how many cycling books you read you'll never know quite how to ride until you sit on the saddle, take hold of the handle-bars and push on the pedals. This is the key to learning: getactively involved." 1 . Pressing CAPS SHIFT and ENTER a second time gives 1 . It's obvious when this happens and does not cause any confusion. From time to timeyou might find it helpful to write a line of BASIC or some other information down on paper.As a general rule, if you want to make a note of something thendo." 1 . If you are unable to do this then two hintsare available. 1 . Explanations are shown in blue. In order to get the most from 1 . If you load in the first programand then the second program you will find that the first programhas gone. Loading a program automatically removes any program already in the Spectrum. 1 . Follow this saving procedure: 1 . These areknown as default values. 1 . Try 1 . Try 1 -7.7142e-6 1 -2 2 1 , then enter 1 , say. The second program may go from line 1 , i.e. the programs are combined. You will find out later on that this can be quite useful. 1 , for instance. 1 , type keyword, stepback, delete 1 , it must be followed by 1 ) you mustenter the graphics mode. This isdone by pressing CAPS SHIFT andGRAPHICS {just GRAPH}. Repeat toleave the graphics mode. 1 ) of the first Learning Element will appear. You will still have control overBASIC though. This is the beautyof our system." 1 ) is placed at the wrong part so you can immediately make a correction. This will be an enormous help toyou (on other computers you onlyfind the faults when you run theprogram)." 1 (21+4)/10 1 ' without usingany single letters or spaces. 1 #0;"Hello!": 1 #0;"Hello!" Hello! 1 "ZX Spectrum" 1 "The sound heard when ENTER is pressed can be turned off. Throughout 1 "The quick brown fox jumps over the lazy dog." 1 "Close";"together"'" 1 "Clive said ""Let there be colour.""" 1 "'"far","apart" 1 ""module x"" 1 ""module e"" 1 " 1 you will find that it grows more and more interesting." 1 you couldhave simply pressed the ENTER key. This clears the screen and prints a section of your program(if there is a program). 1 you are allowing for additional lines to be placed atthe beginning of the program later on. Increments of 10 allowyou to insert extra lines between those that were originally written. 1 would be printedon the lower part of the screenbut it would immediately be over-written with the O.K. message. Instead, enter 1 with your program. 1 with your own." 1 with paper and ink coloursinterchanged: 1 will print on the first row. Experiment with various 1 will list the program from line 1 where x=1 for 'on'and x=0 for 'off' (default value0) is used to print over charac-ters already on the screen. Try: 1 when 'loading' the second program you will find that you can list from line 1 to check your answer. 1 thenumber 11 is printed on thescreen. Your Spectrum has actedlike a calculator. The computing symbol formultiplication is 1 then your Spectrum can be directed to place a 1 then hold down CAPS SHIFT and press ENTER to give 1 the program again. 1 the Solution, then 1 that are stepped through by holding down SYMBOL SHIFT and pressing SPACE. DO THIS NOW. You can use SYMBOL SHIFT and ENTER to step backwards." 1 tends to be somewhat more detailed. If you still feel unable to solve the 1 tells your Spectrum to execute each instruction in turn, starting at the lowest line number. You can choose to start running your program at line 1 statements. As far as it's concerned, a program with or without 1 statements. The lowerpart of the display consists oftwo rows. 1 statements. 1 statements,you could have used: 1 statements are there to help programmers and are ignored by computers. 1 statements act both as prompts to help us to remember the purpose of chunks of BASIC at a later date, and asaids to help other people understand the program. Enter this program 1 statements is the same program. 1 statementand then placing another 1 statement,i.e. they are temporary colours.(Remember that 1 sound can be toggled(turned off if it is on or turned on if it is off) by holding down the SPACE key {bar}and pressing ENTER. The border temporarily becomes magenta in acknowledgment." 1 sets the background colour for the main screen. 1 reversed (inverted). 1 reset the Spectrum, i.e. pull out the plug and then put it back in {press the reset button on the left hand side of the casing}. 1 ranges from 0 to 7. For a red border enter 1 prog name 1 play the cassette in your tape recorder and wait. 1 overwrites 1 operators. 1 operators haveequal priority and are carriedout in order, left to right. Thesame goes for 1 on your program. 1 on its own willproduce a blank line. 1 offers a little help in solving the 1 messages will be displayed." 1 means 4.34x10 1 means 1.25x10 1 material (you still have control over BASIC). So it is a simple matter to step through each Learning Element." 1 makes the colours brighter. Experiment with 1 keywords are shown in 1 items andseparators used so far. 1 is worked out firstsince it has been placed in brac-kets. 1 is the letter of the Learning Module you want) e.g. 1 is short for REMark and its sole purpose is to make programs easier to read. 1 is present!" 1 is not recorded properly and you should save it a second time (try adjusting thevolume control on your tape recorder). 1 is any name you want that is no longer than ten letters, numbers, etc. 1 is about the material covered so far. You areusually expected to produce a short BASIC program in order to solve the 1 is a number from 0 to 31.Try this example: 1 is 1 for 'on' and0 for 'off'. 1 instructions change the colours in a permanant way. They can be used as direct entryinstructions or as part of a program. If you have a black andwhite television the colours correspond to different shades of grey. 1 instruction. 1 instruct-ions, where 1 instead of 1 in order to execute (carry out) the program. Do it now. (Remember that SYMBOL SHIFT and ENTER is used to step back.) 1 in order to keep 1 in BASIC. You can look at, run and alter the 1 gives normal paper. 1 gives normal colours but 1 gives 20because 1 for you to run etc. 1 for 21+4 1 followed by the des-ired keyword.You can then removethe 1 etc. are easyenough to place between quotesbut what of the keywords forwhich a 1 ensures that thepaper (background) colour isaltered similarly. 1 does not in itself use the screen. 1 displays the entire programpage by page. 1 cursor is needed? There is a trick you can use:type 1 contains more information and suggestions for futher programming. When you have loaded a Learning Module you will find that you have complete control of Spectrum BASIC. At first sight you can't tell that 1 command was executed (carried out) straight away. Now type 1 can be 1 to 7 andcorresponds to the colours abovethe number keys on the keyboard. 1 by creating a BASIC program and running it. Pressing SYMBOL SHIFT and SPACE a third time gives the 1 but please refer to the manual if the need arises. 1 but it flashes on and off: 1 are called operators. 1 andmake the border colour differentfrom the paper colour. 1 and step for-ward. 1 and other BASIC is shown in 1 and ENTER. Notice that the command will be entered into a list. 1 and increased by 10. This is common practice since by starting at line 1 active. This applies to all Learning Modules. 1 You will learn how to avoid errors as you use 1 You can save programs at any time while using 1 Write and run a program thatprints on the screen: The quick brown fox jumps over the lazy dog. 1 While we're on the subject ofprograms it is as well to mention 1 When you have learnt BASIC andwant to write a program of reasonable size, you will find it much easier if you first planon paper. More of this later on! 1 When the line you want to edit is displayed at the bottom of the screen you can then insert keywords etc. at the current cursor position or move the cursor to a suitable place using CAPS SHIFT and 5 or CAPS SHIFT and 8 {left and right handarrows to the left of the space bar} or delete using CAPS SHIFT and 0 {DELETE}. Experiment with the Spectrum's edit facility. Change 1 Wait for the O.K. message. Note: 1 Try systematically printingall the characters on each key. 1 This short program prints a friendly message 110 1 This is the end of Learning Module A. If you've understood most of what you've done so far then continue with the package, otherwise press SYMBOL SHIFT and SPACE to return to the start. 1 The list that you are creating is called a program. Enter 1 The Spectrum completely ignores 1 Suppose you want to change part of a program, there are several ways to do this. If you want to replace a specific line with an amended line then simplyenter the new line and it will replace the old one. Try it with 1 Suppose you have saved two programs on tape. The first program goes from line 1 Start your tape recorder recording (on a blank cassette!!) 1 So typing in the program and debugging it (removing errors) constituted most of the programmers hands-on time. With the advent of personal computers there is no need to work out your program on paper before going to the keyboard. You can now make up your programwhile using the computer. Old hackers would doubtless baulk at 'composing at the screen'. 1 So far you will have had no difficulty in displaying a program. With very large programs you may have to use the 1 Rewind tape to the place where 1 Press any key 1 Numbers can be printed with-out using quotation marks. So 1 Now delete line 1 Notice that the two input rowsuse the border colour for a background (paper) and the Spectrum automatically picks a contrasting colour for the text (ink). 1 Notice that the numbers 0-7 correspond to eight different colours. These are clearly shownabove the first row of keys. You can change the border to a specific colour by using 1 Notice that the line numbers have started at 1 Note that 1 It is always a good idea to verify that your program has been saved properly. To do this: 1 Interactive BASIC Programming 1 Instead of using 1 In the event of such an error occuring, program running is halted and an error message is displayed on the lower part of the screen. The same message canbe found in Appendix B of the Spectrum Manual {see Screen Reports near the end of the manual} along with an explanation of the cause. 1 In the early days of computingcomputer time was very costly and people would queue to get their hands on a keyboard (terminal). The early programmers had to have their programs written down on paper. This ensured effective use of those precious minutes allocatedto the user! 1 If your Spectrum eventually comes up with the O.K. message then your program is safely on tape. If you get the tape loading error message then 1 If you've completely finishedwith a program then entering 1 If you're learning BASIC you will only be writing small programs and need to experiment with your computer. Hence, making up programs from the keyboard is as convenient asthe impact is immediate. Do it. 1 If you want to delete a line, then simply enter its number. Suppose you have written a rather long line of BASIC and you now want to alter a small part of it. Instead of rewritingthe whole line you can use Spectrum's edit facility. This is obtained by pressing CAPS SHIFT and EDIT {just press the EDIT key}. Try this now. 1 If you use 1 If you enter 1 Connect MIC on your Spectrum to MIC on your tape recorder. 1 As far as programmers are concerned 1 Another way of displaying a page of program listing is to simply press ENTER. This displays lines around the current edit line. Try this also. 1 Although your Spectrum will not allow you to enter BASIC lines that it cannot understand it is possible that a line cannot be executed by the computer (because, for example, it does not have enough information). 1 All computers accept two typesof keyboard inputs: those that start with a number and those that don't. If a number is present (at the very beginning of a line of input) then your Spectrum places the line (in numerical order) in a list in memory for later use. If a number is not present then the Spectrum carries out (executes) the line immediately.Type 1 A copy of one of the program lines then appears on the input part of the screen. Notice too that an arrow appears in the program listing corresponding tothe copied line. This arrow is used to indicate the current edit line and can be moved up ordown by using CAPS SHIFT and 7 or CAPS SHIFT and 6 {use up or down arrow keys to the right of the space bar}. If you alter thecurrent edit line and press CAPSSHIFT and EDIT {EDIT} then the new edit line appears on the input part of the screen. Try this now. 1 = -9080000 and 1 = -0.0000077142 1 (try it!), you should use 1 (for a blue background) you won't see any difference in the screen. This is because you have yet to print anything. You see, 1 (SYMBOL SHIFT;first row, last key) {SYMBOLSHIFT; first row, second keyfrom the end}. 1 "prog name" 1 "Goodbye" 1 will set the colour for the text. Set the ink to a colour of your choice. 1 using steady characters. 1 thenSpectrum assumes 1 should not be considered the best, yours could easily be better. It will probably be useful to compare our 1 prints: 1 places the number 56on the screen. 1 on bright paper: 1 must be entered after 1 have higher prioritythan 1 You need only use one pairof brackets. 1 Write a program that printsthese numbers with their decimalpoints aligned but don't usespaces (" ") in your text: 100.01, 13.96, 2345.9, 0.04,1.25 1 Write a program that printsthe word Rainbow vertically, onthe left hand side of the screen 1 Write a program that printsthe days of the week in such away that the 'day' parts appearone beneath the other. This isknown as right justified text. 1 Write a program that prints' 1 What happens if you forgetto place items between theseparators? 1 The Spectrum screen is madeup of 24 rows (lines) numbered 0to 23 from top to bottom and 32columns numbered 0 to 31 left toright. In order to print at aspecific place use the word 1 Remember to do multiplica-tions and divisions first. 1 Place each 1 Now enter 1 you should experiment as much aspossible. Remember that you are in control. (O.K. so you're not in this first part!). Tell the machine what you want it to do: make it earn the electricity it's eating." 1 to checkyour answer. 1 instructions. 1 has been written for use with a Spectrum or Spectrum +. Additional information for Spectrum + users is given between braces, i.e. { and } " 1 exists for months!" 1 You must place two spacesbetween 'over' and 'the' other-wise the 'the' will be spreadacross two lines (not a prettysight!). 1 You cannot easily print onthe bottom two rows as these arereserved for input. (Try 1 You can force the Spectrumto carry out additions and sub-tractions before multiplicationsand divisions by using brackets. 1 Remember to use the commaand semicolon; they're important 1 Remember the semicolons: 1 Now for a secret: you canprint on the lower half of thescreen! 1 If you don't specify 1 Did you use character 198(see Appendix A of Spectrum manu-al) for 1 A note on writing programs 1 -n n x is the same as 1/x 1 where 1 for instance, because it's there. Other computers hide suchthings in the manual so you might not find out that 1 You can use several pairsof brackets. Even bracket withinbrackets: INNER MOST BRACKETSARE EXECUTED FIRST. 1 You can use 1 Turn to Appendix A of theSpectrum manual. {The characterset at the beginning of chapter4.} A list of Spectrum charact-ers (letters, digits, symbolsand keywords) appear in thesecond column of this table. {Infact they constitute the wholeof the table.} The first 32characters will be of no use toyou yet so ignore them. The restcan be obtained directly fromthe Spectrum keyboard. 1 Remember, for a keyword:type 1 Remember to use a linenumber for a program and quotesfor text. 1 Notice that the number 0has a / through it in order todistinguish it from the letter o 1 Note: you must always useoperators. Spectrum won't accept 1 Modify your program using 1 Many cruel things have been said about the Spectrum keyboard. This is a pity becauseit fulfils its role better than any other computer keyboard. You see, the ZX Spectrum was designed for people who want to learn about BASIC programming, not typing. No one at Sinclair Research ever pretended that Spectrum was a serious business machine. It is simply the best machine on which to get to gripswith BASIC." 1 If you leave out the textafter 1 Displays can be made moreinteresting by using the 1 What happens if the inkand paper colours are both thesame? 1 This is the end of LearningModule B. If you are happy withwhat has been covered so farthen go on to Learning Module C,otherwise repeat this LearningModule. 1 Remember to use 1 Make up a sentence usingSpectrum words and print it. 1 If you use semicolons toseparate each 1 You can print text thatcontains the single entry words. 1 Very large and smallnumbers are written in a specialway. They appear as a mantissa(which is an ordinary number)and an exponent (which is takento be a power of ten). Letter 1 There is no need to usefour separate 1 The organization of 1 (the semicolon must be there!) 1 will load the fifth Learning Module." 1 Use 1 REM 1 Programs and Input 1 Modify the program toread: 1 If you haven't run oursolution to the last problem yetthen go back and do so. You should now know how toprint quotation marks ("). It isdone by typing two quotationmarks. 1 120 1 and 1 Write a program thatillustrates all the printingfacilities encountered so far. 1 In order to print thegraphics characters (seen on thetop row of keys e.g. 1 Experiment with yourkeyboard. 1 Entering 1 This Learning Modulewill teach you about the manyways to display numbers,letters,words and symbols (i.e. text) onyour television screen. 1 Tape Recorders 1 Make up a few 1 Error Messages 1 (by typing 100 and ENTER) and 1 (where 1 and run it. 1 When 1 Colours 1 (e) 1 (d) 1 (d) 1 This CAL package consists of twelve Learning Modules: this isthe first one. To load a Learning Module: 1 110 1 RANDOMIZE USR 1 The 1 and run it. 1 1